package com.bcx.crm.spring.aop.aopTransaction;

import com.bcx.crm.mapper.templateTestMapper.InsertTemplateMapper;
import com.bcx.crm.plat.core.utils.SpringContextHolder;
import com.bcx.crm.service.templateTestService.InsertTemplateService;
import org.springframework.stereotype.Service;

/**
 * Created by ys on 2018/3/14.
 */
@Service
public class Log314Service {
    /**
     * 根据aop通过配置文件进行声明式事务测试
     */
    public void insertTemplateLog314(){
        InsertTemplateMapper insertTemplateMapper = SpringContextHolder.getBean("insertTemplateMapper");
        int i = insertTemplateMapper.insertTemplate1(InsertTemplateService.createMap());
        if (i>0)throw new IllegalStateException("故意抛出异常");
    }
}
